<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <meta name="Content-Type" content="text/html; charset=UTF-8" />
<title>Class: Sass::Script::Number</title>
<link rel="stylesheet" href="style.css" tppabs="http://sass-lang.com/docs/yardoc/css/style.css" type="text/css" media="screen" charset="utf-8" />
<link rel="stylesheet" href="common.css" tppabs="http://sass-lang.com/docs/yardoc/css/common.css" type="text/css" media="screen" charset="utf-8" />

<script type="text/javascript" charset="utf-8">
  relpath = '../..';
  if (relpath != '') relpath += '/';
</script>
<script type="text/javascript" charset="utf-8" src="jquery.js" tppabs="http://sass-lang.com/docs/yardoc/js/jquery.js"></script>
<script type="text/javascript" charset="utf-8" src="app.js" tppabs="http://sass-lang.com/docs/yardoc/js/app.js"></script>

  </head>
  <body>
    <script type="text/javascript" charset="utf-8">
      if (window.top.frames.main) document.body.className = 'frames';
    </script>
    
    <div id="header">
      <div id="menu">
  
    <a href="_index.html" tppabs="http://sass-lang.com/docs/yardoc/_index.html">Index (N)</a> &raquo; 
    <span class='title'><a href="Sass-1.html" tppabs="http://sass-lang.com/docs/yardoc/Sass.html" title="Sass (module)">Sass</a></span> &raquo; <span class='title'><a href="Script.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script.html" title="Sass::Script (module)">Script</a></span>
     &raquo; 
    <span class="title">Number</span>
  
  
  <div class="noframes"><span class="title">(</span><a href="javascript:if(confirm(%27http://sass-lang.com/docs/yardoc/Sass/Script/.  \n\nThis file was not retrieved by Teleport Pro, because the server reports that this file cannot be found.  \n\nDo you want to open it from the server?%27))window.location=%27http://sass-lang.com/docs/yardoc/Sass/Script/.%27" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/." target="_top">no frames</a><span class="title">)</span></div>
</div>

      <div id="search">
  <a id="class_list_link" href="#">Class List</a>
  <a id="method_list_link" href="#">Method List</a>
  <a id ="file_list_link" href="#">File List</a>
</div>

      <div class="clear"></div>
    </div>
    
    <iframe id="search_frame"></iframe>
    
    <div id="content"><h1>Class: Sass::Script::Number 
  
  
</h1>

<dl class="box">
  
    <dt class="r1">Inherits:</dt>
    <dd class="r1">
      <span class="inheritName"><a href="Literal.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Literal.html" title="Sass::Script::Literal (class)">Literal</a></span>
      
        <ul class="fullTree">
          <li>Object</li>
          
            <li class="next"><a href="Node-1.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Node.html" title="Sass::Script::Node (class)">Node</a></li>
          
            <li class="next"><a href="Literal.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Literal.html" title="Sass::Script::Literal (class)">Literal</a></li>
          
            <li class="next">Sass::Script::Number</li>
          
        </ul>
        <a href="#" class="inheritanceTree">show all</a>
      
      </dd>
    
  
  
    
  
    
  
  
    <dt class="r2 last">Defined in:</dt>
    <dd class="r2 last">/var/www/sass-pages/.sass/lib/sass/script/number.rb</dd>
  
</dl>
<div class="clear"></div>

<h2>Overview</h2><div class="docstring">
  <div class="discussion">
    <p>A SassScript object representing a number. SassScript numbers can have decimal values, and can also have units. For example, <code>12</code>, <code>1px</code>, and <code>10.45em</code> are all valid values.</p>

<p>Numbers can also have more complex units, such as <code>1px*em/in</code>. These cannot be inputted directly in Sass code at the moment.</p>

  </div>
</div>
<div class="tags">
  
</div>
  <h2>Constant Summary</h2>
  


  
  
  
  
  
  
  
  
  <h2>Instance Attribute Summary</h2>
  <ul class="summary">
    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#denominator_units-instance_method" title="#denominator_units (instance method)">- (Array&lt;String&gt;) <strong>denominator_units</strong> </a>
    

    
  </span>
  
  
    <span class="note title readonly">readonly</span>
    
  
  
  
  

  
    <span class="summary_desc">A list of units in the denominator of the number.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#numerator_units-instance_method" title="#numerator_units (instance method)">- (Array&lt;String&gt;) <strong>numerator_units</strong> </a>
    

    
  </span>
  
  
    <span class="note title readonly">readonly</span>
    
  
  
  
  

  
    <span class="summary_desc">A list of units in the numerator of the number.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#original-instance_method" title="#original (instance method)">- (Boolean<sup>?</sup>) <strong>original</strong> </a>
    

    
  </span>
  
  
    
    
  
  
  
  

  
    <span class="summary_desc">The original representation of this number.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#value-instance_method" title="#value (instance method)">- (Numeric) <strong>value</strong> </a>
    

    
  </span>
  
  
    <span class="note title readonly">readonly</span>
    
  
  
  
  

  
    <span class="summary_desc">The Ruby value of the number.</span>
  
</li>

    
  </ul>


  <h2>Class Method Summary</h2>

  <ul class="summary">
    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#const_missing-class_method" title="const_missing (class method)">+ <strong>const_missing</strong>(const) </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">Handles the deprecation warning for the PRECISION constant This can be removed in 3.2.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#precision-class_method" title="precision (class method)">+ <strong>precision</strong> </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc"></span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#precision%3D-class_method" title="precision= (class method)">+ <strong>precision</strong>(digits) </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">Sets the number of digits of precision For example, if this is <code>3</code>, <code>3.1415926</code> will be printed as <code>3.142</code>.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#precision_factor-class_method" title="precision_factor (class method)">+ <strong>precision_factor</strong> </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">the precision factor used in numeric output it is derived from the <code>precision</code> method.</span>
  
</li>

    
  </ul>

  <h2>Instance Method Summary</h2>

  <ul class="summary">
    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#coerce-instance_method" title="#coerce (instance method)">- (Number) <strong>coerce</strong>(num_units, den_units) </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">Returns this number converted to other units.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#comparable_to%3F-instance_method" title="#comparable_to? (instance method)">- (Boolean) <strong>comparable_to?</strong>(other) </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">Whether or not this number can be compared with the other.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#div-instance_method" title="#div (instance method)">- (Literal) <strong>div</strong>(other) </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">The SassScript <code>/</code> operation.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#eq-instance_method" title="#eq (instance method)">- (Boolean) <strong>eq</strong>(other) </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">The SassScript <code>==</code> operation.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#gt-instance_method" title="#gt (instance method)">- (Boolean) <strong>gt</strong>(other) </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">The SassScript <code>&gt;</code> operation.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#gte-instance_method" title="#gte (instance method)">- (Boolean) <strong>gte</strong>(other) </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">The SassScript <code>&gt;=</code> operation.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#initialize-instance_method" title="#initialize (instance method)">- (Number) <strong>initialize</strong>(value, numerator_units = NO_UNITS, denominator_units = NO_UNITS) </a>
    

    
  </span>
  
    <span class="note title constructor">constructor</span>
  
  
  
  
  

  
    <span class="summary_desc">A new instance of Number.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#inspect-instance_method" title="#inspect (instance method)">- (String) <strong>inspect</strong>(opts = {}) </a>
    

    
      (also: #to_sass)
    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">Returns a readable representation of this number.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#int%3F-instance_method" title="#int? (instance method)">- (Boolean) <strong>int?</strong> </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">Whether or not this number is an integer.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#legal_units%3F-instance_method" title="#legal_units? (instance method)">- (Boolean) <strong>legal_units?</strong> </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">Whether or not this number has units that can be represented in CSS (that is, zero or one <tt><a href="#numerator_units-instance_method" title="Sass::Script::Number#numerator_units (method)">#numerator_units</a></tt>).</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#lt-instance_method" title="#lt (instance method)">- (Boolean) <strong>lt</strong>(other) </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">The SassScript <code>&lt;</code> operation.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#lte-instance_method" title="#lte (instance method)">- (Boolean) <strong>lte</strong>(other) </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">The SassScript <code>&lt;=</code> operation.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#minus-instance_method" title="#minus (instance method)">- (Literal) <strong>minus</strong>(other) </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">The SassScript binary <code>-</code> operation (e.g. <code>$a - $b</code>).</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#mod-instance_method" title="#mod (instance method)">- (Number) <strong>mod</strong>(other) </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">The SassScript <code>%</code> operation.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#plus-instance_method" title="#plus (instance method)">- (Literal) <strong>plus</strong>(other) </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">The SassScript <code>+</code> operation.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#times-instance_method" title="#times (instance method)">- (Number, Color) <strong>times</strong>(other) </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">The SassScript <code>*</code> operation.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#to_i-instance_method" title="#to_i (instance method)">- (Fixnum) <strong>to_i</strong> </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">The integer value of the number.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#to_s-instance_method" title="#to_s (instance method)">- (String) <strong>to_s</strong>(opts = {}) </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">The CSS representation of this number.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#unary_minus-instance_method" title="#unary_minus (instance method)">- (Number) <strong>unary_minus</strong> </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">The SassScript unary <code>-</code> operation (e.g. <code>-$a</code>).</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#unary_plus-instance_method" title="#unary_plus (instance method)">- (Number) <strong>unary_plus</strong> </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">The SassScript unary <code>+</code> operation (e.g. <code>+$a</code>).</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#unit_str-instance_method" title="#unit_str (instance method)">- (String) <strong>unit_str</strong> </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">Returns a human readable representation of the units in this number.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#unitless%3F-instance_method" title="#unitless? (instance method)">- (Boolean) <strong>unitless?</strong> </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">Whether or not this number has no units.</span>
  
</li>

    
  </ul>

  
  
  
  
  
  <h3 class="inherited">Methods inherited from <a href="Literal.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Literal.html" title="Sass::Script::Literal (class)">Literal</a></h3>
  <p class="inherited"><a href="Literal.html#%3D%3D-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Literal.html#%3D%3D-instance_method" title="Sass::Script::Literal#== (method)">#==</a>, <a href="Literal.html#_perform-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Literal.html#_perform-instance_method" title="Sass::Script::Literal#_perform (method)">#_perform</a>, <a href="Literal.html#assert_int%21-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Literal.html#assert_int%21-instance_method" title="Sass::Script::Literal#assert_int! (method)">#assert_int!</a>, <a href="Literal.html#children-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Literal.html#children-instance_method" title="Sass::Script::Literal#children (method)">#children</a>, <a href="Literal.html#comma-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Literal.html#comma-instance_method" title="Sass::Script::Literal#comma (method)">#comma</a>, <a href="Literal.html#deep_copy-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Literal.html#deep_copy-instance_method" title="Sass::Script::Literal#deep_copy (method)">#deep_copy</a>, <a href="Literal.html#neq-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Literal.html#neq-instance_method" title="Sass::Script::Literal#neq (method)">#neq</a>, <a href="Literal.html#null%3F-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Literal.html#null%3F-instance_method" title="Sass::Script::Literal#null? (method)">#null?</a>, <a href="Literal.html#options-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Literal.html#options-instance_method" title="Sass::Script::Literal#options (method)">#options</a>, <a href="Literal.html#single_eq-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Literal.html#single_eq-instance_method" title="Sass::Script::Literal#single_eq (method)">#single_eq</a>, <a href="Literal.html#space-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Literal.html#space-instance_method" title="Sass::Script::Literal#space (method)">#space</a>, <a href="Literal.html#to_a-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Literal.html#to_a-instance_method" title="Sass::Script::Literal#to_a (method)">#to_a</a>, <a href="Literal.html#to_bool-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Literal.html#to_bool-instance_method" title="Sass::Script::Literal#to_bool (method)">#to_bool</a>, <a href="Literal.html#unary_div-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Literal.html#unary_div-instance_method" title="Sass::Script::Literal#unary_div (method)">#unary_div</a>, <a href="Literal.html#unary_not-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Literal.html#unary_not-instance_method" title="Sass::Script::Literal#unary_not (method)">#unary_not</a></p>

  
  
  
  
  
  <h3 class="inherited">Methods inherited from <a href="Node-1.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Node.html" title="Sass::Script::Node (class)">Node</a></h3>
  <p class="inherited"><a href="Node-1.html#_perform-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Node.html#_perform-instance_method" title="Sass::Script::Node#_perform (method)">#_perform</a>, <a href="Node-1.html#children-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Node.html#children-instance_method" title="Sass::Script::Node#children (method)">#children</a>, <a href="Node-1.html#dasherize-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Node.html#dasherize-instance_method" title="Sass::Script::Node#dasherize (method)">#dasherize</a>, <a href="Node-1.html#deep_copy-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Node.html#deep_copy-instance_method" title="Sass::Script::Node#deep_copy (method)">#deep_copy</a>, <a href="Node-1.html#opts-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Node.html#opts-instance_method" title="Sass::Script::Node#opts (method)">#opts</a>, <a href="Node-1.html#perform-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Node.html#perform-instance_method" title="Sass::Script::Node#perform (method)">#perform</a></p>
<div id="constructor_details" class="method_details_list">
  <h2>Constructor Details</h2>
  
    <div class="method_details first">
  <p class="signature first" id="initialize-instance_method">
  
    - (<tt><a href="" title="Sass::Script::Number (class)">Number</a></tt>) <strong>initialize</strong>(value, numerator_units = NO_UNITS, denominator_units = NO_UNITS) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>A new instance of Number</p>

  </div>
</div>
<div class="tags">
  <h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='type'>(<tt>Numeric</tt>)</span>
      
      
        <span class='name'>value</span>
      
      
      
        &mdash;
        The value of the number
      
    </li>
  
    <li>
      
        <span class='type'>(<tt>Array&lt;<a href="String.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/String.html" title="Sass::Script::String (class)">String</a>&gt;</tt>)</span>
      
      
        <span class='name'>numerator_units</span>
      
      
        <em class="default">(defaults to: <tt>NO_UNITS</tt>)</em>
      
      
        &mdash;
        See <tt><a href="#numerator_units-instance_method" title="Sass::Script::Number#numerator_units (method)">#numerator_units</a></tt>
      
    </li>
  
    <li>
      
        <span class='type'>(<tt>Array&lt;<a href="String.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/String.html" title="Sass::Script::String (class)">String</a>&gt;</tt>)</span>
      
      
        <span class='name'>denominator_units</span>
      
      
        <em class="default">(defaults to: <tt>NO_UNITS</tt>)</em>
      
      
        &mdash;
        See <tt><a href="#denominator_units-instance_method" title="Sass::Script::Number#denominator_units (method)">#denominator_units</a></tt>
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


73
74
75
76
77
78</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/script/number.rb', line 73</span>

def initialize(value, numerator_units = NO_UNITS, denominator_units = NO_UNITS)
  super(value)
  @numerator_units = numerator_units
  @denominator_units = denominator_units
  normalize!
end</pre>
    </td>
  </tr>
</table>
</div>
  
</div>

  <div id="instance_attr_details" class="attr_details">
    <h2>Instance Attribute Details</h2>
    
      
      <span id=""></span>
      <span id="denominator_units-instance_method"></span>
      <div class="method_details first">
  <p class="signature first" id="denominator_units-instance_method">
  
    - (<tt>Array&lt;<a href="String.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/String.html" title="Sass::Script::String (class)">String</a>&gt;</tt>) <strong>denominator_units</strong>  <span class="extras">(readonly)</span>
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>A list of units in the denominator of the number. For example, <code>1px*em/in*cm</code> would return <code>[&quot;in&quot;, &quot;cm&quot;]</code></p>

  </div>
</div>
<div class="tags">
  <h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt>Array&lt;<a href="String.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/String.html" title="Sass::Script::String (class)">String</a>&gt;</tt>)</span>
      
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


26
27
28</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/script/number.rb', line 26</span>

def denominator_units
  @denominator_units
end</pre>
    </td>
  </tr>
</table>
</div>
    
      
      <span id=""></span>
      <span id="numerator_units-instance_method"></span>
      <div class="method_details ">
  <p class="signature " id="numerator_units-instance_method">
  
    - (<tt>Array&lt;<a href="String.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/String.html" title="Sass::Script::String (class)">String</a>&gt;</tt>) <strong>numerator_units</strong>  <span class="extras">(readonly)</span>
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>A list of units in the numerator of the number. For example, <code>1px*em/in*cm</code> would return <code>[&quot;px&quot;, &quot;em&quot;]</code></p>

  </div>
</div>
<div class="tags">
  <h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt>Array&lt;<a href="String.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/String.html" title="Sass::Script::String (class)">String</a>&gt;</tt>)</span>
      
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


21
22
23</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/script/number.rb', line 21</span>

def numerator_units
  @numerator_units
end</pre>
    </td>
  </tr>
</table>
</div>
    
      
      <span id="original=-instance_method"></span>
      <span id="original-instance_method"></span>
      <div class="method_details ">
  <p class="signature " id="original-instance_method">
  
    - (<tt>Boolean</tt><sup>?</sup>) <strong>original</strong> 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>The original representation of this number. For example, although the result of <code>1px/2px</code> is <code>0.5</code>, the value of <code>#original</code> is <code>&quot;1px/2px&quot;</code>.</p>

<p>This is only non-nil when the original value should be used as the CSS value, as in <code>font: 1px/2px</code>.</p>

  </div>
</div>
<div class="tags">
  <h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt>Boolean</tt>, <tt>nil</tt>)</span>
      
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


36
37
38</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/script/number.rb', line 36</span>

def original
  @original
end</pre>
    </td>
  </tr>
</table>
</div>
    
      
      <span id=""></span>
      <span id="value-instance_method"></span>
      <div class="method_details ">
  <p class="signature " id="value-instance_method">
  
    - (<tt>Numeric</tt>) <strong>value</strong>  <span class="extras">(readonly)</span>
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>The Ruby value of the number.</p>

  </div>
</div>
<div class="tags">
  <h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt>Numeric</tt>)</span>
      
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


16
17
18</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/script/number.rb', line 16</span>

def value
  @value
end</pre>
    </td>
  </tr>
</table>
</div>
    
  </div>


  <div id="class_method_details" class="method_details_list">
    <h2>Class Method Details</h2>
    
    
      <div class="method_details first">
  <p class="signature first" id="const_missing-class_method">
  
    + <strong>const_missing</strong>(const) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Handles the deprecation warning for the PRECISION constant This can be removed in 3.2.</p>

  </div>
</div>
<div class="tags">
  
</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


58
59
60
61
62
63
64
65</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/script/number.rb', line 58</span>

def self.const_missing(const)
  if const == :PRECISION
    Sass::Util.sass_warn("Sass::Script::Number::PRECISION is deprecated and will be removed in a future release. Use Sass::Script::Number.precision_factor instead.")
    const_set(:PRECISION, self.precision_factor)
  else
    super
  end
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="precision-class_method">
  
    + <strong>precision</strong> 
  

  
</p><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


38
39
40</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/script/number.rb', line 38</span>

def self.precision
  @precision ||= 5
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="precision=-class_method">
  
    + <strong>precision=</strong>(digits) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Sets the number of digits of precision For example, if this is <code>3</code>, <code>3.1415926</code> will be printed as <code>3.142</code>.</p>

  </div>
</div>
<div class="tags">
  
</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


45
46
47
48</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/script/number.rb', line 45</span>

def self.precision=(digits)
  @precision = digits.round
  @precision_factor = 10.0**@precision
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="precision_factor-class_method">
  
    + <strong>precision_factor</strong> 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>the precision factor used in numeric output it is derived from the <code>precision</code> method.</p>

  </div>
</div>
<div class="tags">
  
</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


52
53
54</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/script/number.rb', line 52</span>

def self.precision_factor
  @precision_factor ||= 10.0**precision
end</pre>
    </td>
  </tr>
</table>
</div>
    
  </div>

  <div id="instance_method_details" class="method_details_list">
    <h2>Instance Method Details</h2>
    
    
      <div class="method_details first">
  <p class="signature first" id="coerce-instance_method">
  
    - (<tt><a href="" title="Sass::Script::Number (class)">Number</a></tt>) <strong>coerce</strong>(num_units, den_units) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Returns this number converted to other units. The conversion takes into account the relationship between e.g. mm and cm, as well as between e.g. in and cm.</p>

<p>If this number has no units, it will simply return itself with the given units.</p>

<p>An incompatible coercion, e.g. between px and cm, will raise an error.</p>

  </div>
</div>
<div class="tags">
  <h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='type'>(<tt>Array&lt;<a href="String.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/String.html" title="Sass::Script::String (class)">String</a>&gt;</tt>)</span>
      
      
        <span class='name'>num_units</span>
      
      
      
        &mdash;
        The numerator units to coerce this number into. See <tt><a href="#numerator_units-instance_method" title="Sass::Script::Number#numerator_units (method)">#numerator_units</a></tt>
      
    </li>
  
    <li>
      
        <span class='type'>(<tt>Array&lt;<a href="String.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/String.html" title="Sass::Script::String (class)">String</a>&gt;</tt>)</span>
      
      
        <span class='name'>den_units</span>
      
      
      
        &mdash;
        The denominator units to coerce this number into. See <tt><a href="#denominator_units-instance_method" title="Sass::Script::Number#denominator_units (method)">#denominator_units</a></tt>
      
    </li>
  
</ul>
<h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt><a href="" title="Sass::Script::Number (class)">Number</a></tt>)</span>
      
      
      
      
        &mdash;
        The number with the new units
      
    </li>
  
</ul>
<h3>Raises:</h3>
<ul class="raise">
  
    <li>
      
        <span class='type'>(<tt><a href="UnitConversionError.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/UnitConversionError.html" title="Sass::UnitConversionError (class)">Sass::UnitConversionError</a></tt>)</span>
      
      
      
      
        &mdash;
        if the given units are incompatible with the number&#8217;s current units
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


321
322
323
324
325
326
327
328</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/script/number.rb', line 321</span>

def coerce(num_units, den_units)
  Number.new(if unitless?
               self.value
             else
               self.value * coercion_factor(@numerator_units, num_units) /
                 coercion_factor(@denominator_units, den_units)
             end, num_units, den_units)
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="comparable_to?-instance_method">
  
    - (<tt>Boolean</tt>) <strong>comparable_to?</strong>(other) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Whether or not this number can be compared with the other.</p>

  </div>
</div>
<div class="tags">
  <h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='type'>(<tt><a href="" title="Sass::Script::Number (class)">Number</a></tt>)</span>
      
      
        <span class='name'>other</span>
      
      
      
        &mdash;
        A number to decide if it can be compared with this number.
      
    </li>
  
</ul>
<h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt>Boolean</tt>)</span>
      
      
      
      
        &mdash;
        Whether or not this number can be compared with the other.
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


332
333
334
335
336
337
338
339</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/script/number.rb', line 332</span>

def comparable_to?(other)
  begin
    operate(other, :+)
    true
  rescue Sass::UnitConversionError
    false
  end
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="div-instance_method">
  
    - (<tt><a href="Literal.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Literal.html" title="Sass::Script::Literal (class)">Literal</a></tt>) <strong>div</strong>(other) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>The SassScript <code>/</code> operation. Its functionality depends on the type of its argument:</p>

<dl>
<dt><tt><a href="" title="Sass::Script::Number (class)">Number</a></tt></dt>

<dd>Divides this number by the other, converting units appropriately.</dd>

<dt><tt><a href="Literal.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Literal.html" title="Sass::Script::Literal (class)">Literal</a></tt></dt>

<dd>See <tt><a href="Literal.html#div-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Literal.html#div-instance_method" title="Sass::Script::Literal#div (method)">Literal#div</a></tt>.</dd>
</dl>

  </div>
</div>
<div class="tags">
  <h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='type'>(<tt><a href="Literal.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Literal.html" title="Sass::Script::Literal (class)">Literal</a></tt>)</span>
      
      
        <span class='name'>other</span>
      
      
      
        &mdash;
        The right-hand side of the operator
      
    </li>
  
</ul>
<h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt><a href="Literal.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Literal.html" title="Sass::Script::Literal (class)">Literal</a></tt>)</span>
      
      
      
      
        &mdash;
        The result of the operation
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


172
173
174
175
176
177
178
179
180
181
182</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/script/number.rb', line 172</span>

def div(other)
  if other.is_a? Number
    res = operate(other, :/)
    if self.original && other.original
      res.original = "#{self.original}/#{other.original}"
    end
    res
  else
    super
  end
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="eq-instance_method">
  
    - (<tt>Boolean</tt>) <strong>eq</strong>(other) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>The SassScript <code>==</code> operation.</p>

  </div>
</div>
<div class="tags">
  <h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='type'>(<tt><a href="Literal.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Literal.html" title="Sass::Script::Literal (class)">Literal</a></tt>)</span>
      
      
        <span class='name'>other</span>
      
      
      
        &mdash;
        The right-hand side of the operator
      
    </li>
  
</ul>
<h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt>Boolean</tt>)</span>
      
      
      
      
        &mdash;
        Whether this number is equal to the other object
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


205
206
207
208
209
210
211
212
213
214
215
216
217
218
219</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/script/number.rb', line 205</span>

def eq(other)
  return Sass::Script::Bool.new(false) unless other.is_a?(Sass::Script::Number)
  this = self
  begin
    if unitless?
      this = this.coerce(other.numerator_units, other.denominator_units)
    else
      other = other.coerce(@numerator_units, @denominator_units)
    end
  rescue Sass::UnitConversionError
    return Sass::Script::Bool.new(false)
  end

  Sass::Script::Bool.new(this.value == other.value)
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="gt-instance_method">
  
    - (<tt>Boolean</tt>) <strong>gt</strong>(other) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>The SassScript <code>&gt;</code> operation.</p>

  </div>
</div>
<div class="tags">
  <h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='type'>(<tt><a href="" title="Sass::Script::Number (class)">Number</a></tt>)</span>
      
      
        <span class='name'>other</span>
      
      
      
        &mdash;
        The right-hand side of the operator
      
    </li>
  
</ul>
<h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt>Boolean</tt>)</span>
      
      
      
      
        &mdash;
        Whether this number is greater than the other
      
    </li>
  
</ul>
<h3>Raises:</h3>
<ul class="raise">
  
    <li>
      
        <span class='type'>(<tt>NoMethodError</tt>)</span>
      
      
      
      
        &mdash;
        if <code>other</code> is an invalid type
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


226
227
228
229</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/script/number.rb', line 226</span>

def gt(other)
  raise NoMethodError.new(nil, :gt) unless other.is_a?(Number)
  operate(other, :>)
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="gte-instance_method">
  
    - (<tt>Boolean</tt>) <strong>gte</strong>(other) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>The SassScript <code>&gt;=</code> operation.</p>

  </div>
</div>
<div class="tags">
  <h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='type'>(<tt><a href="" title="Sass::Script::Number (class)">Number</a></tt>)</span>
      
      
        <span class='name'>other</span>
      
      
      
        &mdash;
        The right-hand side of the operator
      
    </li>
  
</ul>
<h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt>Boolean</tt>)</span>
      
      
      
      
        &mdash;
        Whether this number is greater than or equal to the other
      
    </li>
  
</ul>
<h3>Raises:</h3>
<ul class="raise">
  
    <li>
      
        <span class='type'>(<tt>NoMethodError</tt>)</span>
      
      
      
      
        &mdash;
        if <code>other</code> is an invalid type
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


236
237
238
239</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/script/number.rb', line 236</span>

def gte(other)
  raise NoMethodError.new(nil, :gte) unless other.is_a?(Number)
  operate(other, :>=)
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="inspect-instance_method">
  
    - (<tt><a href="String.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/String.html" title="Sass::Script::String (class)">String</a></tt>) <strong>inspect</strong>(opts = {}) 
  

  
    <span class="aliases">Also known as:
    <span class="names"><span id='to_sass-instance_method'>to_sass</span></span>
    </span>
  
</p><div class="docstring">
  <div class="discussion">
    <p>Returns a readable representation of this number.</p>

<p>This representation is valid CSS (and valid SassScript) as long as there is only one unit.</p>

  </div>
</div>
<div class="tags">
  <h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt><a href="String.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/String.html" title="Sass::Script::String (class)">String</a></tt>)</span>
      
      
      
      
        &mdash;
        The representation
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


276
277
278
279</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/script/number.rb', line 276</span>

def inspect(opts = {})
  value = self.class.round(self.value)
  unitless? ? value.to_s : "#{value}#{unit_str}"
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="int?-instance_method">
  
    - (<tt>Boolean</tt>) <strong>int?</strong> 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Whether or not this number is an integer.</p>

  </div>
</div>
<div class="tags">
  <h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt>Boolean</tt>)</span>
      
      
      
      
        &mdash;
        Whether or not this number is an integer.
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


290
291
292</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/script/number.rb', line 290</span>

def int?
  value % 1 == 0.0
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="legal_units?-instance_method">
  
    - (<tt>Boolean</tt>) <strong>legal_units?</strong> 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Whether or not this number has units that can be represented in CSS (that is, zero or one <tt><a href="#numerator_units-instance_method" title="Sass::Script::Number#numerator_units (method)">#numerator_units</a></tt>).</p>

  </div>
</div>
<div class="tags">
  <h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt>Boolean</tt>)</span>
      
      
      
      
        &mdash;
        Whether or not this number has units that can be represented in CSS (that is, zero or one <tt><a href="#numerator_units-instance_method" title="Sass::Script::Number#numerator_units (method)">#numerator_units</a></tt>).
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


301
302
303</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/script/number.rb', line 301</span>

def legal_units?
  (@numerator_units.empty? || @numerator_units.size == 1) && @denominator_units.empty?
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="lt-instance_method">
  
    - (<tt>Boolean</tt>) <strong>lt</strong>(other) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>The SassScript <code>&lt;</code> operation.</p>

  </div>
</div>
<div class="tags">
  <h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='type'>(<tt><a href="" title="Sass::Script::Number (class)">Number</a></tt>)</span>
      
      
        <span class='name'>other</span>
      
      
      
        &mdash;
        The right-hand side of the operator
      
    </li>
  
</ul>
<h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt>Boolean</tt>)</span>
      
      
      
      
        &mdash;
        Whether this number is less than the other
      
    </li>
  
</ul>
<h3>Raises:</h3>
<ul class="raise">
  
    <li>
      
        <span class='type'>(<tt>NoMethodError</tt>)</span>
      
      
      
      
        &mdash;
        if <code>other</code> is an invalid type
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


246
247
248
249</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/script/number.rb', line 246</span>

def lt(other)
  raise NoMethodError.new(nil, :lt) unless other.is_a?(Number)
  operate(other, :<)
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="lte-instance_method">
  
    - (<tt>Boolean</tt>) <strong>lte</strong>(other) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>The SassScript <code>&lt;=</code> operation.</p>

  </div>
</div>
<div class="tags">
  <h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='type'>(<tt><a href="" title="Sass::Script::Number (class)">Number</a></tt>)</span>
      
      
        <span class='name'>other</span>
      
      
      
        &mdash;
        The right-hand side of the operator
      
    </li>
  
</ul>
<h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt>Boolean</tt>)</span>
      
      
      
      
        &mdash;
        Whether this number is less than or equal to the other
      
    </li>
  
</ul>
<h3>Raises:</h3>
<ul class="raise">
  
    <li>
      
        <span class='type'>(<tt>NoMethodError</tt>)</span>
      
      
      
      
        &mdash;
        if <code>other</code> is an invalid type
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


256
257
258
259</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/script/number.rb', line 256</span>

def lte(other)
  raise NoMethodError.new(nil, :lte) unless other.is_a?(Number)
  operate(other, :<=)
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="minus-instance_method">
  
    - (<tt><a href="Literal.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Literal.html" title="Sass::Script::Literal (class)">Literal</a></tt>) <strong>minus</strong>(other) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>The SassScript binary <code>-</code> operation (e.g. <code>$a - $b</code>). Its functionality depends on the type of its argument:</p>

<dl>
<dt><tt><a href="" title="Sass::Script::Number (class)">Number</a></tt></dt>

<dd>Subtracts this number from the other, converting units if possible.</dd>

<dt><tt><a href="Literal.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Literal.html" title="Sass::Script::Literal (class)">Literal</a></tt></dt>

<dd>See <tt><a href="Literal.html#minus-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Literal.html#minus-instance_method" title="Sass::Script::Literal#minus (method)">Literal#minus</a></tt>.</dd>
</dl>

  </div>
</div>
<div class="tags">
  <h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='type'>(<tt><a href="Literal.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Literal.html" title="Sass::Script::Literal (class)">Literal</a></tt>)</span>
      
      
        <span class='name'>other</span>
      
      
      
        &mdash;
        The right-hand side of the operator
      
    </li>
  
</ul>
<h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt><a href="Literal.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Literal.html" title="Sass::Script::Literal (class)">Literal</a></tt>)</span>
      
      
      
      
        &mdash;
        The result of the operation
      
    </li>
  
</ul>
<h3>Raises:</h3>
<ul class="raise">
  
    <li>
      
        <span class='type'>(<tt><a href="UnitConversionError.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/UnitConversionError.html" title="Sass::UnitConversionError (class)">Sass::UnitConversionError</a></tt>)</span>
      
      
      
      
        &mdash;
        if <code>other</code> is a number with incompatible units
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


117
118
119
120
121
122
123</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/script/number.rb', line 117</span>

def minus(other)
  if other.is_a? Number
    operate(other, :-)
  else
    super
  end
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="mod-instance_method">
  
    - (<tt><a href="" title="Sass::Script::Number (class)">Number</a></tt>) <strong>mod</strong>(other) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>The SassScript <code>%</code> operation.</p>

  </div>
</div>
<div class="tags">
  <h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='type'>(<tt><a href="" title="Sass::Script::Number (class)">Number</a></tt>)</span>
      
      
        <span class='name'>other</span>
      
      
      
        &mdash;
        The right-hand side of the operator
      
    </li>
  
</ul>
<h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt><a href="" title="Sass::Script::Number (class)">Number</a></tt>)</span>
      
      
      
      
        &mdash;
        This number modulo the other
      
    </li>
  
</ul>
<h3>Raises:</h3>
<ul class="raise">
  
    <li>
      
        <span class='type'>(<tt>NoMethodError</tt>)</span>
      
      
      
      
        &mdash;
        if <code>other</code> is an invalid type
      
    </li>
  
    <li>
      
        <span class='type'>(<tt><a href="UnitConversionError.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/UnitConversionError.html" title="Sass::UnitConversionError (class)">Sass::UnitConversionError</a></tt>)</span>
      
      
      
      
        &mdash;
        if <code>other</code> has any units
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


190
191
192
193
194
195
196
197
198
199</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/script/number.rb', line 190</span>

def mod(other)
  if other.is_a?(Number)
    unless other.unitless?
      raise Sass::UnitConversionError.new("Cannot modulo by a number with units: #{other.inspect}.")
    end
    operate(other, :%)
  else
    raise NoMethodError.new(nil, :mod)
  end
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="plus-instance_method">
  
    - (<tt><a href="Literal.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Literal.html" title="Sass::Script::Literal (class)">Literal</a></tt>) <strong>plus</strong>(other) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>The SassScript <code>+</code> operation. Its functionality depends on the type of its argument:</p>

<dl>
<dt><tt><a href="" title="Sass::Script::Number (class)">Number</a></tt></dt>

<dd>Adds the two numbers together, converting units if possible.</dd>

<dt><tt><a href="Color.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Color.html" title="Sass::Script::Color (class)">Color</a></tt></dt>

<dd>Adds this number to each of the RGB color channels.</dd>

<dt><tt><a href="Literal.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Literal.html" title="Sass::Script::Literal (class)">Literal</a></tt></dt>

<dd>See <tt><a href="Literal.html#plus-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Literal.html#plus-instance_method" title="Sass::Script::Literal#plus (method)">Literal#plus</a></tt>.</dd>
</dl>

  </div>
</div>
<div class="tags">
  <h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='type'>(<tt><a href="Literal.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Literal.html" title="Sass::Script::Literal (class)">Literal</a></tt>)</span>
      
      
        <span class='name'>other</span>
      
      
      
        &mdash;
        The right-hand side of the operator
      
    </li>
  
</ul>
<h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt><a href="Literal.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Literal.html" title="Sass::Script::Literal (class)">Literal</a></tt>)</span>
      
      
      
      
        &mdash;
        The result of the operation
      
    </li>
  
</ul>
<h3>Raises:</h3>
<ul class="raise">
  
    <li>
      
        <span class='type'>(<tt><a href="UnitConversionError.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/UnitConversionError.html" title="Sass::UnitConversionError (class)">Sass::UnitConversionError</a></tt>)</span>
      
      
      
      
        &mdash;
        if <code>other</code> is a number with incompatible units
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


95
96
97
98
99
100
101
102
103</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/script/number.rb', line 95</span>

def plus(other)
  if other.is_a? Number
    operate(other, :+)
  elsif other.is_a?(Color)
    other.plus(self)
  else
    super
  end
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="times-instance_method">
  
    - (<tt><a href="" title="Sass::Script::Number (class)">Number</a></tt>, <tt><a href="Color.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Color.html" title="Sass::Script::Color (class)">Color</a></tt>) <strong>times</strong>(other) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>The SassScript <code>*</code> operation. Its functionality depends on the type of its argument:</p>

<dl>
<dt><tt><a href="" title="Sass::Script::Number (class)">Number</a></tt></dt>

<dd>Multiplies the two numbers together, converting units appropriately.</dd>

<dt><tt><a href="Color.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Color.html" title="Sass::Script::Color (class)">Color</a></tt></dt>

<dd>Multiplies each of the RGB color channels by this number.</dd>
</dl>

  </div>
</div>
<div class="tags">
  <h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='type'>(<tt><a href="" title="Sass::Script::Number (class)">Number</a></tt>, <tt><a href="Color.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Color.html" title="Sass::Script::Color (class)">Color</a></tt>)</span>
      
      
        <span class='name'>other</span>
      
      
      
        &mdash;
        The right-hand side of the operator
      
    </li>
  
</ul>
<h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt><a href="" title="Sass::Script::Number (class)">Number</a></tt>, <tt><a href="Color.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Color.html" title="Sass::Script::Color (class)">Color</a></tt>)</span>
      
      
      
      
        &mdash;
        The result of the operation
      
    </li>
  
</ul>
<h3>Raises:</h3>
<ul class="raise">
  
    <li>
      
        <span class='type'>(<tt>NoMethodError</tt>)</span>
      
      
      
      
        &mdash;
        if <code>other</code> is an invalid type
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


151
152
153
154
155
156
157
158
159</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/script/number.rb', line 151</span>

def times(other)
  if other.is_a? Number
    operate(other, :*)
  elsif other.is_a? Color
    other.times(self)
  else
    raise NoMethodError.new(nil, :times)
  end
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="to_i-instance_method">
  
    - (<tt>Fixnum</tt>) <strong>to_i</strong> 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>The integer value of the number</p>

  </div>
</div>
<div class="tags">
  <h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt>Fixnum</tt>)</span>
      
      
      
      
        &mdash;
        The integer value of the number
      
    </li>
  
</ul>
<h3>Raises:</h3>
<ul class="raise">
  
    <li>
      
        <span class='type'>(<tt><a href="SyntaxError.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/SyntaxError.html" title="Sass::SyntaxError (class)">Sass::SyntaxError</a></tt>)</span>
      
      
      
      
        &mdash;
        if the number isn&#8217;t an integer
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


284
285
286
287</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/script/number.rb', line 284</span>

def to_i
  super unless int?
  return value
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="to_s-instance_method">
  
    - (<tt><a href="String.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/String.html" title="Sass::Script::String (class)">String</a></tt>) <strong>to_s</strong>(opts = {}) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>The CSS representation of this number</p>

  </div>
</div>
<div class="tags">
  <h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt><a href="String.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/String.html" title="Sass::Script::String (class)">String</a></tt>)</span>
      
      
      
      
        &mdash;
        The CSS representation of this number
      
    </li>
  
</ul>
<h3>Raises:</h3>
<ul class="raise">
  
    <li>
      
        <span class='type'>(<tt><a href="SyntaxError.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/SyntaxError.html" title="Sass::SyntaxError (class)">Sass::SyntaxError</a></tt>)</span>
      
      
      
      
        &mdash;
        if this number has units that can&#8217;t be used in CSS (e.g. <code>px*in</code>)
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


264
265
266
267
268</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/script/number.rb', line 264</span>

def to_s(opts = {})
  return original if original
  raise Sass::SyntaxError.new("#{inspect} isn't a valid CSS value.") unless legal_units?
  inspect
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="unary_minus-instance_method">
  
    - (<tt><a href="" title="Sass::Script::Number (class)">Number</a></tt>) <strong>unary_minus</strong> 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>The SassScript unary <code>-</code> operation (e.g. <code>-$a</code>).</p>

  </div>
</div>
<div class="tags">
  <h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt><a href="" title="Sass::Script::Number (class)">Number</a></tt>)</span>
      
      
      
      
        &mdash;
        The negative value of this number
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


135
136
137</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/script/number.rb', line 135</span>

def unary_minus
  Number.new(-value, @numerator_units, @denominator_units)
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="unary_plus-instance_method">
  
    - (<tt><a href="" title="Sass::Script::Number (class)">Number</a></tt>) <strong>unary_plus</strong> 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>The SassScript unary <code>+</code> operation (e.g. <code>+$a</code>).</p>

  </div>
</div>
<div class="tags">
  <h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt><a href="" title="Sass::Script::Number (class)">Number</a></tt>)</span>
      
      
      
      
        &mdash;
        The value of this number
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


128
129
130</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/script/number.rb', line 128</span>

def unary_plus
  self
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="unit_str-instance_method">
  
    - (<tt><a href="String.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/String.html" title="Sass::Script::String (class)">String</a></tt>) <strong>unit_str</strong> 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Returns a human readable representation of the units in this number. For complex units this takes the form of: numerator_unit1 * numerator_unit2 / denominator_unit1 * denominator_unit2</p>

  </div>
</div>
<div class="tags">
  <h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt><a href="String.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/String.html" title="Sass::Script::String (class)">String</a></tt>)</span>
      
      
      
      
        &mdash;
        a string that represents the units in this number
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


345
346
347
348
349
350
351
352</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/script/number.rb', line 345</span>

def unit_str
  rv = @numerator_units.sort.join("*")
  if @denominator_units.any?
    rv << "/"
    rv << @denominator_units.sort.join("*")
  end
  rv
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="unitless?-instance_method">
  
    - (<tt>Boolean</tt>) <strong>unitless?</strong> 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Whether or not this number has no units.</p>

  </div>
</div>
<div class="tags">
  <h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt>Boolean</tt>)</span>
      
      
      
      
        &mdash;
        Whether or not this number has no units.
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


295
296
297</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/script/number.rb', line 295</span>

def unitless?
  @numerator_units.empty? && @denominator_units.empty?
end</pre>
    </td>
  </tr>
</table>
</div>
    
  </div>

</div>
    
    <div id="footer">
  Generated on Fri Mar  8 20:34:01 2013 by 
  <a href="javascript:if(confirm(%27http://yardoc.org/  \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address.  \n\nDo you want to open it from the server?%27))window.location=%27http://yardoc.org/%27" tppabs="http://yardoc.org/" title="Yay! A Ruby Documentation Tool">yard</a>
  0.5.3 (ruby-1.8.7).
</div>


  <script type="text/javascript">
  var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
  document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
  </script>
  <script type="text/javascript">
  try {
  var pageTracker = _gat._getTracker("UA-535380-8");
  pageTracker._trackPageview();
  } catch(err) {}</script>


  </body>
</html>